package com.ze.controller;

import com.ze.model.User;
import com.ze.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource(name = "userServiceImpl")
    private UserService userService;

    @RequestMapping(value="/login")
    public String user(@RequestParam(name="name",required=false) String name, @RequestParam(name="password",required=false) String password){
        User user = new User();
        user.setName(name);
        user.setPassword(password);

        boolean result = userService.valid(user);
        System.out.println(result);

        return "success";
    }

}
